from flask import Flask
from app.api.v1.endpoints.auth import auth
from app.db.session import engine
from app.models.user import Base

def create_app():
    app = Flask(__name__)

    # 注册蓝图
    app.register_blueprint(auth, url_prefix="/api/v1")

    # 初始化数据库
    Base.metadata.create_all(bind=engine)

    return app

app = create_app()

if __name__ == "__main__":
    app.run(host="0.0.0.0", port=5000, debug=True)
